package it.gma.torero.parsing.token;

import it.gma.torero.operand.ObjectOperand;
import it.gma.torero.operand.Operand;
import it.gma.torero.parsing.Tokenizer.ReturnType;

public class ValueConstant extends Constant {

	ValueConstant(String sequence) {
		super(sequence);
	}

	@Override
	public ReturnType getReturnType() {
		return ReturnType.VALUE;
	}

	@Override
	public Operand asOperand() {
		if ("'null'".equals(getSequence())) {
			return new ObjectOperand(null);
		}
		
		return new ObjectOperand(getSequence().replace("'", ""));
	}
}
